# verison  1
def CR2(fn):
    def inner1(*x1):
        def inner2(x2):
            return fn(*x1,x2)
        return inner2
    return inner1
def CR(fn,n=None):
    if n is None:
        n = fn.__code__.co_argcount
    if n < 2:
        return fn
    @CR2
    def inner(*x):
        return fn(*x)
    return CR(inner,n-1)

###测试用
foo = lambda x1,x2,x3 :print(x1,x2,x3)
cur = CR(foo)
cur1 = cur(1)
cur2 = cur1(2)
print('~~~\n')
cur3 = cur2(3)
print('\n\n\n~~~\n\n\n')
print(*map(type,(cur,cur1,cur2,cur3)),'\n',cur3,sep='\n')
